home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / arexx / zedrexx.lha / ZedREXX / REXX / zRegister.zrx < prev    next >
Text File  |  1994-08-22  |  5KB  |  185 lines

  1. /* $VER: zregister.zrx 1.0 (03.08.94)
  2.  * Copyright (c) 1994 Reality Check, Inc.
  3.  * Written by David N. Junod
  4.  *
  5.  */
  6.  
  7. OPTIONS RESULTS
  8. SIGNAL ON HALT
  9.  
  10. /* For Demo Purposes... */
  11. Info("S:",info.)
  12. IF info.DiskState="WRITE_PROTECTED"    THEN PersistVol="ENV"
  13.                     ELSE PersistVol="S"
  14.  
  15.     /* Application Data */
  16.     'zInterface zRegister PersistFile='||PersistVol||':ZedREXX.zdb'
  17.     'zImage Magnify Width=11 Height=9 Depth=1 Data="3E006300C180C180C18063003EC000E00060"'
  18.     'zImage ZrxIcon File="ZedREXX:icons/zedrexx.info"'
  19.     'zWindow Main Label "Register" Open Centered Horizontal CloseEvent ChildMaxHeight'
  20.         'zMenu Project'
  21.         'zObject Button Quit Label "&Quit" SelectEvent'
  22.         'zEndMenu'
  23.         'zGroup Vertical'
  24.         'zObject TextEntry Name Label "&Name:" MaxChars 64 NumColumns 32 Persist'
  25.         'zObject TextEntry Address1 Label "Address:" MaxChars 64 NumColumns 32 Persist'
  26.         'zObject TextEntry City Label "City:" MaxChars 64 NumColumns 32 Persist'
  27.         'zObject TextEntry State Label "State/Province:" MaxChars 2 NumColumns 3 Persist'
  28.         'zObject TextEntry Zip Label "Postal/Zip Code:" MaxChars 15 Persist'
  29.         'zObject TextEntry Country Label "Country:" MaxChars 20 Persist Value="USA"'
  30.         'zObject TextEntry DPhone Label "Day Phone:" MaxChars 20 Persist'
  31.         'zObject TextEntry EPhone Label "Eve.Phone:" MaxChars 20 Persist'
  32.         'zObject TextEntry Internet Label "Internet:" MaxChars 64 NumColumns 32 Persist'
  33.         'zObject TextEntry Bix Label "Bix:" MaxChars 64 NumColumns 32 Persist'
  34.         'zObject Line'
  35.         'zObject TextDisplay Status Fill'
  36.         'zEndGroup'
  37.         'zObject Line'
  38.         'zGroup Vertical ChildMaxWidth'
  39.         'zGroup Horizontal Justification=Center'
  40.             'zObject ButtonG IB1 Image=ZrxIcon ReadOnly NoBorder'
  41.         'zEndGroup'
  42.         'zGroup Vertical ChildMaxWidth Justification=Bottom'
  43.             'zObject Button Print Label="&Print" SelectEvent'
  44.             'zObject Line'
  45.             'zObject Button Exit Label="E&xit" SelectEvent'
  46.         'zEndGroup'
  47.         'zEndGroup'
  48.     'zEndWindow'
  49.     'zEndInterface'
  50.  
  51.     CALL Initialize
  52.  
  53.     /* Enter the event loop */
  54.     DO FOREVER
  55.  
  56.         /* Wait for something to happen */
  57.         'zWaitForEvent stem.'
  58.  
  59.         /* Do something with the event */
  60.         INTERPRET "zRC="RESULT"()"
  61.     END
  62.  
  63. Halt:
  64. Quit_Select:
  65. Exit_Select:
  66. zRegister_Quit:
  67. Main_Close:
  68. Cancel_Select:
  69.     CALL Shutdown
  70.     EXIT
  71.  
  72. Initialize:
  73.     'zSetAttr Status Value="Fill in information & Print"'
  74.  
  75.     /* Turn everything on */
  76.     'zDoMethod zRegister Activate'
  77.     RETURN
  78.  
  79. Shutdown:
  80.     'zDoMethod Main Save'
  81.     RETURN
  82.  
  83. /* Print button pressed */
  84. Print_Select:
  85.     /* Show them that something is going on */
  86.     'zDoMethod zRegister Lock'
  87.  
  88.     /* Get the fields from the window */
  89.     'zGetAttr Main Fields fields.'
  90.  
  91.     /* Create the registration file */
  92.     outName="ram:register.txt"
  93.     IF OPEN(out,outName,write) THEN DO
  94.     ds=DateStamp()
  95.     PARSE VAR ds dow date time
  96.     CALL WRITELN(out,"")
  97.     CALL WRITELN(out,"")
  98.     CALL WRITELN(out,"")
  99.     CALL WRITELN(out,"")
  100.     CALL WRITELN(out,date)
  101.     CALL WRITELN(out,"")
  102.     CALL WRITELN(out,"")
  103.     CALL WRITELN(out,"")
  104.     CALL WRITELN(out,"")
  105.     CALL WRITELN(out,"Reality Check, Inc.")
  106.     CALL WRITELN(out,"ZedREXX Registration")
  107.     CALL WRITELN(out,"5543 Edmondson Pike, #134")
  108.     CALL WRITELN(out,"Nashville, TN 37211")
  109.     CALL WRITELN(out,"")
  110.     CALL WRITELN(out,"")
  111.     CALL WRITELN(out,"")
  112.     CALL WRITELN(out,"")
  113.     CALL WRITELN(out,"Enclosed is the required check or money order for 35 US dollars (plus")
  114.     CALL WRITELN(out,"shipping and handling according to the ReadMe file) made payable to")
  115.     CALL WRITELN(out,"Reality Check, Inc.")
  116.     CALL WRITELN(out,"")
  117.     CALL WRITELN(out,"My pertinent information is as follows.")
  118.     CALL WRITELN(out,"")
  119.     CALL WRITELN(out,"      NAME:" fields.name)
  120.     CALL WRITELN(out,"   ADDRESS:" fields.address1)
  121.     CALL WRITELN(out,"   ADDRESS:" fields.city"," fields.state fields.zip)
  122.     CALL WRITELN(out,"   COUNTRY:" fields.country)
  123.     CALL WRITELN(out,"   DAY TEL:" fields.dphone)
  124.     CALL WRITELN(out,"   EVE.TEL:" fields.ephone)
  125.     CALL WRITELN(out,"  INTERNET:" fields.internet)
  126.     CALL WRITELN(out,"       BIX:" fields.bix)
  127.  
  128.     /* Get the machine configuration */
  129.     cnt=0
  130.     TmpFile=TmpFile("T:.config")
  131.     ADDRESS COMMAND "ShowConfig >"TmpFile
  132.     IF ((RC=0) & (OPEN(in,TmpFile,read))) THEN DO
  133.         DO WHILE EOF(in)=0
  134.         inStr=READLN(in)
  135.         IF cnt=0 THEN CALL WRITELN(out,"    CONFIG:")
  136.         WRITELN(out,inStr)
  137.         cnt=cnt+1
  138.         END
  139.         CLOSE(in)
  140.         DeleteFile(TmpFile)
  141.         END
  142.     IF (cnt=0) THEN DO
  143.         CALL WRITELN(out,"    WB VER:" GetVar("Workbench"))
  144.         CALL WRITELN(out,"  KICK VER:" GetVar("Kickstart"))
  145.         END
  146.  
  147.     /* Finish out the letter */
  148.     CALL WRITELN(out,"")
  149.     CALL WRITELN(out,"Please rush me the complete ZedREXX package which includes; disk, printed")
  150.     CALL WRITELN(out,"manual, AmigaGuide manual and Amiga memorabilia (only available to the")
  151.     CALL WRITELN(out,"first 250 registrants).")
  152.     CALL WRITELN(out,"")
  153.     CALL WRITELN(out,"Sincerely,")
  154.     CALL WRITELN(out,"")
  155.     CALL WRITELN(out,"")
  156.     CALL WRITELN(out,"")
  157.     CALL WRITELN(out,"")
  158.     CALL WRITELN(out,fields.name)
  159.  
  160.     /* Form feed */
  161.     CALL WRITECH(out,'C'x)
  162.     CALL CLOSE(out)
  163.  
  164.     IF (OPEN(out,"PRT:",write) & OPEN(in,outName,read)) THEN DO
  165.         DO WHILE EOF(in)=0
  166.         inStr=READLN(in)
  167.         CALL WRITELN(out,inStr)
  168.         END
  169.         CLOSE(in)
  170.         END
  171.  
  172.     /* Set the status line */
  173.     statMsg="Registration file in"
  174.     END
  175.     ELSE DO
  176.     statMsg="Couldn't write to file"
  177.     END
  178.  
  179.     /* Set the status line */
  180.     'zSetAttr Status Value=' statMsg outName
  181.  
  182.     /* Unlock the UI */
  183.     'zDoMethod zRegister Unlock'
  184.     RETURN 0
  185.